const SYSTEM_INFO = uni.getSystemInfoSync();
//安全区
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight || 15 ;



//胶囊按钮的盒子高度，让titleBar和胶囊按钮保持高度一致
export const getTitleBarHeight = ()=>{
	if(uni.getMenuButtonBoundingClientRect){
		let {top,height} = uni.getMenuButtonBoundingClientRect();
		return (height + (top - getStatusBarHeight())*2); 
	}
	else{
		return 60;
	}
	
};

//整体高度
export const getNavBarHeight = ()=>getStatusBarHeight() + getTitleBarHeight();


//抖音小程序的兼容，抖音小程序最左侧有个小程序图标
export const getLeftIconLeft = ()=>{
	
	
	// #ifdef MP-TOUTIAO
		let {leftIcon:{left,width}} = tt.getCustomButtonBoundingClientRect();
		return left + parseInt(width) + 5;
	// #endif
	
	// #ifndef MP-TOUTIAO
		return 0
	// #endif
}